#pragma once

#include "Reflection/Reflection.h"
#include "Containers/String.h"

#include "Guid.m.h"

// standard guid is 32 bits - 16 bits - 16 bits - 16 bits - 48 bits 
RSTRUCT()
struct WHENGINE_API SGuid
{
    ROBJECT
public:
    
    uint32_t A;
    uint16_t B;
    uint16_t C;
    uint64_t D;


    SGuid(uint32_t InA
    ,uint16_t InB
    ,uint16_t InC
    ,uint64_t InD)
    :A(InA),B(InB),C(InC),D(InD)
    {
        
    }

    SGuid()
    :A(0),B(0),C(0),D(0)
    {

    }

    static SGuid NewGuid();

    CString ToString() const;

    void Fill(const CString& InString);

    static SGuid FromString(const CString& InString);

    RPROPERTY(Name="StringExpression",Getter="ToString",Setter="Fill")


    bool operator ==(const SGuid& Other) const
    {
        return A==Other.A && B==Other.B && C==Other.C && D==Other.D;
    }

    uint64_t GetHashCode() const;

    bool IsValid() const;
};
